<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta content="telephone=no,email=no" name="format-detection">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="./css/load.css"/>
    <title>下载</title>
    <script src="../baidu.js"></script>
    <script>
        document.getElementsByTagName('html')[0].style.fontSize=document.documentElement.clientWidth/10+'px';
    </script>
    <!--<script src="./js/flexible.js"></script>-->
    <script src="./js/jquery.js"></script>
</head>
<body>
    <div class="root">
        <div class="root-bg">
            <!-- <div class="info">
                下载App 立即拿钱
            </div> -->
            <div class="btn-wrapper">
                <div class="register-button ios-btn">立即下载</div>
                <div class="register-button android-btn">立即下载</div>
            </div>
        </div>
        <img src="./css/images/weixin-tip.png" style="width:300px;position:absolute; right:0px; top:0px; display:none; z-index:1000" id="weixin1">
        <div style="background:url(./css/images/weixin-tip.png); width:100%; height:100%; position:absolute; left:0px; top:0px; display:none; background:#000; filter:alpha(Opacity=50);-moz-opacity:0.5;opacity: 0.5;"
        id="weixin"></div>
    </div>
</body>
</html>
<script src="./js/cookie.js"></script>
<script src="./js/timer.js"></script>
<script>
    var u = navigator.userAgent, 
        isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), 
        height = document.documentElement.clientHeight, 
        selector = isiOS ? ".ios-btn" : ".android-btn";
    $(".root-bg").css("minHeight", height + "px"),
    $(selector).addClass("show-btn"),
    $(".ios-btn").on("click", function() {
        window.location.href = './load2.html'
    });

    var updateUrl
    $.ajax({
        url: "/hs/api/v1/getNewVersion",
        type: "post",
        dataType: "json",
        data: {
            appName: "闪电飞猪",
            os: "android"
        },
        success: function(a) {
            if(200 === Number(a.code)) {
                updateUrl = a.data.updateUrl
            }
        }
    })
    function load() {
        // cookie
        $(this).getC( 2 )
        // 产品地址修改
        window.location.href = updateUrl
    }

     // 倒计时自动注册
    $(window).timer()
    
    $(".android-btn").on("click", function() {
        load()
    });

	if(isiOS)window.location.href = './load2.html';

    isWeixn();

    function isWeixn() {
        var ua = navigator.userAgent.toLowerCase();
        if (ua.match(/MicroMessenger/i) == "micromessenger") {
            document.getElementById("weixin").style.display = "block";
            document.getElementById("weixin1").style.display = "block";
            return true;
        } else {
            return false;
        }
    }

</script>
